//
//  InTrainingItemStackView.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/11/4.
//

import Foundation
import MYModule

open class InTrainingItemCollectionCell: CollectionViewCell {
    
    open var model: TrainingItemModel? {
        
        didSet {
            
            numLabel.text = model?.currentDataTitle
            unitLabel.text = model?.title
            
        }
        
    }
    
    public let line = View()
    
    open override func makeUI() {
        super.makeUI()
        
        line.backgroundColor = UIColor.assist_222222
        
  
        contentView.addSubview(numLabel)
        contentView.addSubview(unitLabel)
        contentView.addSubview(line)
        
        numLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview()
        }
        
        unitLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(numLabel.snp.bottom)
            
        }
        
        
        line.snp.makeConstraints { make in
            make.right.equalToSuperview()
            make.centerY.equalToSuperview()
            make.width.equalTo(1)
            make.height.equalTo(30)
        }

    }
    
    //MARK: - lazy load -
    public lazy var numLabel: Label = {
        let label = Label()
        label.font = Fonts.boldSystemFont(ofSize: 24)
        label.textColor = UIColor.assist_222222
        label.textAlignment = .center
        return label
    }()
    
    public lazy var unitLabel: Label = {
        let label = Label()
        label.font = Fonts.systemFont(ofSize: 12)
        label.textColor = UIColor.assist_A9A9A9
        label.textAlignment = .center
        return label
    }()
}
